package com.mmy.service.oa.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mmy.dao.oa.MaterialInRepository;
import com.mmy.dao.oa.VMaterialInRepository;
import com.mmy.domain.oa.MaterialIn;
import com.mmy.domain.oa.VMaterialIn;
import com.mmy.service.oa.MaterialInService;

@Service
public class MaterialInServiceImpl implements MaterialInService {

	@Autowired
	MaterialInRepository materialInRepository;

	@Autowired
	VMaterialInRepository vMaterialInRepository;

	/**
	 * 查找全部
	 * 
	 * @param
	 * @return
	 */
	public List<VMaterialIn> findAll() {
		// TODO Auto-generated method stub
		return vMaterialInRepository.findAll();
	}


	/**
	 * 获取最大值
	 * 
	 * @param
	 * @return
	 */

	public Object getMaxInID() {
		// TODO Auto-generated method stub
		return materialInRepository.getMaxInID();
	}

	/**
	 * 新增
	 * 
	 * @param
	 * @return
	 */
	public void save(MaterialIn materialIn) {
		// TODO Auto-generated method stub
		materialInRepository.save(materialIn);
	}

	/**
	 * 删除
	 * 
	 * @param
	 * @return
	 */

	public void delMaterialIn(List<Integer> lstInID) {
		// TODO Auto-generated method stub
		materialInRepository.delMaterialIn(lstInID);
	}

	/**
	 * 通过id查找
	 * 
	 * @param
	 * @return
	 */

	public MaterialIn findByInID(int iInID) {
		// TODO Auto-generated method stub
		return materialInRepository.findByInID(iInID);
	}



	/**
	 * 新增id
	 * 
	 * @param
	 * @return
	 */
	public void save(int inID) {
		// TODO Auto-generated method stub
		materialInRepository.save(inID);
	}

	/**
	 * 通过name查找
	 * 
	 * @param
	 * @return
	 */
	public List<VMaterialIn> findByMaterialName(String strMaterialName) {
		// TODO Auto-generated method stub
		return vMaterialInRepository.findByMaterialName(strMaterialName);
	}

}
